//
//  CanLab.m
//  LiangPinZS
//
//  Created by hwd on 17/2/22.
//  Copyright © 2017年 hwd. All rights reserved.
//

#import "CanLab.h"

@implementation CanLab

- (instancetype)initWithFrame:(CGRect)frame textAligment:(NSInteger)aligment font:(CGFloat)font textColor:(NSString *)textColor text:(NSString *)text
{
    if (self = [super initWithFrame:frame]) {
        self.userInteractionEnabled = YES;
        self.textAlignment = aligment;
        self.font = [UIFont systemFontOfSize:font];
        self.textColor = [UIColor colorWithHexString:textColor];
        self.text = text;
        UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(LabTap)];
        [self addGestureRecognizer:tap];
    }
    return self;
}
- (void)LabTap
{
    if (_block) {
        _block(self);
    }
}

@end
